/**
 * Created by Administrator on 2017/3/21.
 */
import React, {Component} from 'react';
import { Form, Button, Badge, Select, DatePicker, Radio, Descriptions, Input, Upload, Icon, TreeSelect } from 'antd';
import {connect} from 'dva';
import moment from 'moment'
import request from '@/utils/request';

const { TextArea } = Input;
const { Option } = Select;
const TreeNode = TreeSelect.TreeNode;
const MonthPicker =DatePicker.MonthPicker

const ButtonGroup = Button.Group;
class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
      all_staffs:[],
      all_organizations:[],
      format:'YYYY-MM-DD',
      all_party_members:[]
    };
  }
  componentDidMount() {
    const that=this;
  }
  render() {
    const {getFieldDecorator} = this.props.form;
    return (
      <div>
        <Form>
          <Descriptions className={'blue-descriptions'} title={<div style={{textAlign:'center',marginTop:'10px'}}></div>} bordered>
          <Descriptions.Item label={this.props.type==='import'?"转入时间":"转出时间"} span={3}>
            {getFieldDecorator('transfer_time', {
              initialValue:this.props.editRecord?this.props.editRecord[this.props.type==='import'?'transfer_in_record':'transfer_out_record'].transfer_time?
                moment(this.props.editRecord[this.props.type==='import'?'transfer_in_record':'transfer_out_record'].transfer_time):'': '',
            })(
              <DatePicker style={{width:'100%'}}/>
            )}
          </Descriptions.Item>
            <Descriptions.Item label={this.props.type==='import'?"原党支部":"转往党支部"} span={3}>
              {getFieldDecorator('target_party_branch', {
                initialValue:this.props.editRecord?this.props.editRecord[this.props.type==='import'?'transfer_in_record':'transfer_out_record'].target_party_branch:'',
              })(
                <Input />
              )}
            </Descriptions.Item>
            <Descriptions.Item label={"人员状态"} span={3}>
              {getFieldDecorator('personnel_status', {
                initialValue:this.props.editRecord?this.props.editRecord[this.props.type==='import'?'transfer_in_record':'transfer_out_record'].personnel_status:'',
              })(
                <Input />
              )}
            </Descriptions.Item>
            <Descriptions.Item label="党费缴纳月份" span={3}>
              {getFieldDecorator('party_fee_payment_month', {
                initialValue:this.props.editRecord?this.props.editRecord[this.props.type==='import'?'transfer_in_record':'transfer_out_record'].party_fee_payment_month?
                  moment(this.props.editRecord[this.props.type==='import'?'transfer_in_record':'transfer_out_record'].party_fee_payment_month):'': '',
              })(
                <MonthPicker   style={{width:'100%'}}/>
              )}
            </Descriptions.Item>
          </Descriptions>
        </Form>

      </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);
